package com.bos.controller;

import com.bos.controller.base.BaseController;
import com.bos.controller.base.imp.BaseControllerImp;
import com.bos.domain.Decidedzone;
import com.bos.domain.Noticebill;
import com.bos.domain.Staff;
import com.bos.service.NoticeBillService;
import com.bos.utils.PageBean;
import com.crm.Customer;
import com.crm.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author Administrator
 */
@Controller
public class NoticebillController extends BaseControllerImp<Noticebill> implements BaseController<Noticebill> {


    @Autowired
    private NoticeBillService noticeBillService;

    @Autowired
    private CustomerService customerService;

    private final String LIST = "page/base/noticebill_add";

    @Autowired
    public NoticebillController(PageBean pageBean){
        super(pageBean);
    }

    /**根据输入的号码回显客户的信息
     * */

    @RequestMapping(value = "/ListNoticebillCustomer",method = RequestMethod.POST)
    @ResponseBody
    public String listStaff(String telephone){
            Customer customer = customerService.findCustomerBytelephone(telephone);
            return java2json(customer,new String[]{});
    }

    /**保存业务通知单
     * */

    @RequestMapping(value = "/SaveNoticebill",method = RequestMethod.POST)
    public String listStaff(Noticebill noticebill){
        noticeBillService.save(noticebill);
        return "qupai/noticebill_add";
    }


}
